<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>业务配置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    #parse('/headFiles.html')
	<style type="text/css">
		.layui-form[wid100] .layui-form-label {
			width: 130px;
		}
		.layui-form[wid100] .layui-input-block {
			margin-left: 160px;
		}
	</style>
</head>
<body>
<div class="layui-fluid">
	<div class="layui-form" id="LAY-config-submit" wid100>
		<div class="layui-card">
			<div class="layui-card-header">
				中能思拓接口配置
				<div style="float:right">
					<button class="layui-btn" lay-submit lay-filter="LAY-znst-config-submit">保存</button>
				</div>
			</div>
			<div class="layui-card-body">
				<div class="layui-row">
					<div class="layui-col-sm4">
						<div class="layui-form-item">
							<label class="layui-form-label">接口域名</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" placeholder="必填项" name="httpDomain" value="$!{znstConfig.httpDomain}">
							</div>
						</div>
					</div>
					<div class="layui-col-sm4">
						<div class="layui-form-item">
							<label class="layui-form-label">账号</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" placeholder="必填项" name="name" value="$!{znstConfig.name}">
							</div>
						</div>
					</div>
					<div class="layui-col-sm4">
						<div class="layui-form-item">
							<label class="layui-form-label">密码</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" placeholder="必填项" name="pwd" value="$!{znstConfig.pwd}">
							</div>
						</div>
					</div>
				</div>
			</div><!-- /.layui-card-body -->
		</div>
	</div><!-- /.layui-form -->
</div><!-- /.layui-fluid -->
#parse('/footFiles.html')
<script type="text/javascript">
layui.config({
	base: '$!{webRoot}/layuiadmin/'
}).extend({
	index: 'lib/index'
}).use(['element', 'index', 'form'], function () {
	var $ = layui.$, form = layui.form;

	form.on('submit(LAY-znst-config-submit)', function (data) {
		var field = data.field;
		$.ajax({
			type: "post",
			url: "$!{webRoot}/ops/outside_api/znst_config/update.do",
			data: field,
			dataType: "json",
			success: function (res) {
				if (res.code == 200) {
					layer.msg('保存成功', {icon: 1});
				} else {
					layer.msg(res.msg, {icon: 2});
				}
			}
		});
	});
});
</script>
</body>
</html>